package 算法基础模板.chapter_01;

/**
 * 区间合并
 * <blockquote><pre>{@code
 *void merge(vector<PII> &segs)
 * {
 *     vector<PII> res;
 *
 *     sort(segs.begin(), segs.end());
 *
 *     int st = -2e9, ed = -2e9;
 *     for (auto seg : segs)
 *         if (ed < seg.first)
 *         {
 *             if (st != -2e9) res.push_back({st, ed});
 *             st = seg.first, ed = seg.second;
 *         }
 *         else ed = max(ed, seg.second);
 *
 *     if (st != -2e9) res.push_back({st, ed});
 *
 *     segs = res;
 * }
 *
 * 作者：yxc
 * 链接：https://www.acwing.com/blog/content/277/
 * 来源：AcWing
 * 著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。
 *
 * }</pre>
 * @author Summerday
 */
public class IntervalMergeT {
}
